package com.guli.common.utils;


import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Configuration
@Component
public class OssUtils implements InitializingBean {

    @Value("${aliyun.endpoint}")
    private String oss_endpoint;//服务器地址

    @Value("${aliyun.bucket}")
    private String oss_bucketname;//bucket名称

    @Value("${aliyun.dir}")
    private String oss_dir;//文件路径

    @Value("${aliyun.access-id}")
    private String oss_access_id;

    @Value("${aliyun.access-key}")
    private String oss_access_key;

    //endpoint：阿里云服务器地址
    public static String ALIYUN_END_POINT = "oss-cn-beijing.aliyuncs.com";
    //accessKeyId：连接阿里云的accessKeyId
    public static String ALIYUN_ACCESS_ID = "LTAI4FuYBzB3ShsaMjhAn26Z";
    //accessKeySecret：连接阿里云的accessKeyScret
    public static String ALIYUN_ACCESS_KEY = "xK1lndT7FutLYQ2hOGNZxTccXosFmQ";

    public static String ALIYUN_BUCKET_NAME = "czylmz";
    public static String ALIYUN_DIR = "mmfix";

    //访问域名地址http://oss-xys.oss-cn-beijing.aliyuncs.com/
    public static final String OSS_PATH = "http://oss-xys.oss-cn-beijing.aliyuncs.com/";

    //文件夹的名称，不存在即创建,不加斜杠即为前缀

    @Override
    public void afterPropertiesSet() throws Exception {
//        ALIYUN_END_POINT =;
//        ALIYUN_ACCESS_ID =;
//        ALIYUN_ACCESS_KEY =;
//        ALIYUN_DIR =;
//        ALIYUN_BUCKET_NAME =;
    }
}